package main

import (
	"fmt"
	"genealogy/dao"
	"genealogy/pkg/gredis"
	"genealogy/pkg/setting"
	"genealogy/routers"
)

func init() {
	setting.Setup() //定义结构体 并连接服务端口，数据库，APP
	dao.Setup()     //生成管理员
	gredis.Setup()  //缓存数据库
}

// @title genealogy-backendServer
// @version 1.0
// @description base on gin
func main() {
	endPoint := fmt.Sprintf(":%d", setting.ServerSetting.HttpPort)
	routersInit := routers.InitRouter()
	routersInit.Run(endPoint)
}
